package com.lightboat.system.domain.request;

import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.DateDeserializers;
import com.fasterxml.jackson.databind.ser.std.DateSerializer;
import com.lightboat.common.annotation.Excel;
import com.lightboat.common.core.domain.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.SchemaProperties;
import io.swagger.v3.oas.annotations.media.SchemaProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * 客户查询请求
 *
 * @author lightboat
 * @date 2025-08-14
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Schema(title = "客户查询请求")
public class CrmCustomerQueryRequest extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 客户ID */
    @SchemaProperty(name = "客户ID")
    @SchemaProperties
    @TableId
    private Long customerId;

    /** 客户来源 */
    @SchemaProperty(name = "客户来源")
    @Excel(name = "客户来源")
    private String customerSource;

    /** 客户姓名 */
    @SchemaProperty(name = "客户姓名")
    @Excel(name = "客户姓名")
    private String customerName;

    /** 客户电话 */
    @SchemaProperty(name = "客户电话")
    @Excel(name = "客户电话")
    private String customerPhone;

    /** 联系地址 */
    @SchemaProperty(name = "联系地址")
    @Excel(name = "联系地址")
    private String contactAddress;

    /** 类别 */
    @SchemaProperty(name = "类别")
    @Excel(name = "类别")
    private String category;

    /** 客户分组 */
    @Schema(title = "客户分组")
    @Excel(name = "客户分组")
    private String group;

    /** 是否添加微信(0 否 1是) */
    @SchemaProperty(name = "是否添加微信(0 否 1是)")
    @Excel(name = "是否添加微信(0 否 1是)")
    private Integer isAddWechat;

    /** 下单时间 */
    @SchemaProperty(name = "下单时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonDeserialize(using = DateDeserializers.DateDeserializer.class)
    @JsonSerialize(using = DateSerializer.class)
    @Excel(name = "下单时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date orderTime;

    /** 业务员ID */
    @SchemaProperty(name = "业务员ID")
    @Excel(name = "业务员ID")
    private Long salesmanId;

    /** 是否分配业务员 0 否 1是 */
    @SchemaProperty(name = "是否分配业务员 0 否 1是")
    @Excel(name = "是否分配业务员 0 否 1是")
    private Integer isAllocatedSalesman;

    /** 类型CODE（用于区分角色） typeCode：1 客服 2 销售*/
    @SchemaProperty(name = "类型CODE（用于区分角色）")
    @Excel(name = "类型CODE")
    private String typeCode;
}
